<?php

namespace app\admin\controller;

use think\Controller;
use think\Db;
use app\admin\model\Con1 as Con1Model;

class Con1 extends Controller
{
    public function index()
    {

        return view('admin@con1/tables');
    }
    public function delete($id)
    {
        $node = new Con1Model();

        $res = $node->where(['id'=>$id])->delete();

        if ($res > 0)
        {
            $info['status'] = true;
            $info['id'] = $id;
            $info['info'] = 'ID为: ' . $id . '的节点删除成功!';
        }else {
            $info['status'] = false;
            $info['id'] = $id;
            $info['info'] = 'ID为: ' . $id . '的节点删除失败!';
        }
        return  json($info);
    }

    public function func1()
    {

    }

    public function func2()
    {
        return view('admin@con1/func2');
    }

}